package com.welab.springcloud.demo.api;

import com.welab.springcloud.demo.api.fallback.UserApiFallback;
import com.welab.springcloud.demo.dto.ResponseResult;
import com.welab.springcloud.demo.dto.User;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

@FeignClient(value = "USER-SERVICE", fallback = UserApiFallback.class)
public interface UserApi {

	@GetMapping(value = "/getUser/{userId}")
	@LoadBalanced()
	ResponseResult<User> getUser(@PathVariable("userId") Integer userId);

}
